<?php

namespace app\services;

use plugin\admin\app\model\Coupon;
use plugin\admin\app\model\User;
use plugin\admin\app\model\UserCoupon;

class VIPService
{
    public static function config()
    {
        $config = ConfigService::get('site');

        return $config;
    }

    public static function toVip($userId)
    {
        $userInfo = User::find($userId);

        if ($userInfo['level'] < 2) {
            $userInfo->level = 2;
            $userInfo->is_vip = 1;

            $userInfo->save();
        }
    }
}